<div class="box-body">
    <form class="layui-form" action="{:url('save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">关键词分类</label>
            <div class="layui-input-block">
                <select name="cate_id" lay-search>
                    <option value="">请选择</option>
                    {foreach $category as $c}
                    <option {if isset($word) && $word.cate_id==$c.cate_id}selected{/if} value="{$c.cate_id}">{php}echo str_repeat("├─",$c['level']);{/php}{$c.name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词类型</label>
            <div class="layui-input-block">
                <select name="type" lay-search>
                    {php}$wordType = isset($word) ? $word->getData("type") : "-1";{/php}
                    {foreach $types as $k => $t}
                    <option {if isset($word) && $wordType==$k}selected{/if} value="{$k}">{$t}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">热度</label>
            <div class="layui-input-block">
                <select name="hot" lay-search>
                    {foreach $hots as $s}
                    <option {if isset($word) && $word.hot == $s}selected{/if} value="{$s}">{$s}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">关键词</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" name="word" {if isset($word)}value="{$word.word}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" name="remark" {if isset($word)}value="{$word.remark}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" value="1" {if !isset($word) || (isset($word) && $word.status=='1')}checked{/if} lay-skin="switch">
            </div>
        </div>
        {if isset($word)}
        <input type="hidden" name="word_id" value="{$word.word_id}">
        {/if}
    </form>
</div>